#pragma once

#include "IRender.h"
#include "Modules.h"


struct IAuxRender;
struct I2DRender;
struct IShader;
struct IShaderManager;
class CFont;
class C2DRender;

class CRender: public IRender, public IRenderObjectBase
{
public:
	CRender();
	virtual ~CRender();

	//	IRender
	virtual bool Init();

	virtual void Update();
	virtual void PreRender();
	virtual void Render();
	virtual void PostRender();
	virtual void ClearBuffer(uint flags, const Color& color, float z);

	virtual uint GetWidth() const;
	virtual uint GetHeight() const;

	virtual void SetShader(const char* name);
	virtual void SetTexture(TextureId texture);
	virtual void DrawPrimitives(EPrimitiveType ptype, const S2DVertex* vertices, uint16 vertex_count,
		const uint16* indices, uint16 index_count);
	virtual void DrawPrimitives(EPrimitiveType ptype, const IVertexBuffer* vertices, uint16 vertex_count,
		const IIndexBuffer* indices, uint16 index_count);

	virtual IFont* GetFont();
	virtual I2DRender* Get2DRender();
	//---

private:
	CFont*						m_pFont;
	C2DRender*				m_p2DRender;
};

REGISTER_GAME_MODULE(IRender, CRender);